<template>
	<view class="member_card">
		<!-- 缺省组件 -->
		<pageEmpty v-if="list.length==0" text="暂无会员卡" ></pageEmpty>
		<view class="member_list" v-else >
			<view :class="['member_item',item.isMember?'member_text':'nomember'] " v-for="(item,index) in list " :key="index">
				<image class="bg" src="https://mg-print.oss-cn-shenzhen.aliyuncs.com/img/isVipBg.png" mode="" v-if="item.isMember==1"></image>
				<image class="bg" src="https://mg-print.oss-cn-shenzhen.aliyuncs.com/img/noVipBg.png" mode="" v-else></image>
				<view class="top">
					<image class="head_img" src="https://mg-print.oss-cn-shenzhen.aliyuncs.com/img/vipHead.png" mode=""></image>
					<view class="center">
						<text>{{item.name}}</text>
						<text v-if="item.isMember">有效期至{{item.time}}</text>
						<text v-else>未开通</text>
					</view>
					<view class="right">
						<text>消费明细</text>
						<image src="https://mg-print.oss-cn-shenzhen.aliyuncs.com/img/arr_right_brown.png" mode=""></image>
					</view>
				</view>
				<view class="bottom">
					<text class="id">ID:{{item.id}}</text>
					<view :class="['button',item.isMember?'renew':'open']">
						<text v-if="item.isMember">立即续费</text>
						<text v-else>开通会员</text>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	// 缺省页
	import pageEmpty from '@/components/pageEmpty/pageEmpty'
	export default {
		components:{
			pageEmpty
		},
		data() {
			return {
				list:[{isMember:0,id:563888888,name:'晨光文具店',time:null},{isMember:1,id:563888888,name:'晨光文具店',time:'2024-10-31'}],
				tabsActive:true
			};
		},
		methods:{
		}
		
	}
</script>
<style>
	page{
		background-color: #f6f6f6;
	}
</style>

<style lang="scss" scoped>
	.bottom{
		display: flex;
		align-items: center;
		justify-content: space-between;
		.id{
			font-size: 24rpx;
		}
		.button{
			width: 176rpx;
			height: 64rpx;
			border-radius: 32rpx;
			display: flex;
			align-items: center;
			justify-content: center;
			text{
				// font-weight: bold;
				font-size: 28rpx;
			}
			
		}
		.open{
			background: linear-gradient( 130deg, #FBE7C8 0%, #D1AD79 100%);
			text {
				color: #543C24;
			}
		}.renew{
			background: linear-gradient( 130deg, #535250 0%, #3C3934 100%);
			text{
				color: #EED8B0;
			}
		}
		
	}
	
	.member_text{
		text{
			color: #6B4C20;
		}
	}
	.nomember{
		text{
			color: #FFEBBC;
		}
	}
	.member_list{
		display: flex;
		flex-direction: column;
		.member_item{
			display: flex;
			flex-direction: column;
			justify-content: space-between;
			.right{
				display: flex;
				align-items: center;
				image{
					width: 24rpx;
					height: 24rpx;
				}
				text{
					font-size: 24rpx;
				}
			}
			.center{
				display: flex;
				justify-content: space-between;
				flex-direction: column;
				height: 100%;
				flex: 1;
				margin-left: 20rpx;
				text{
					&:nth-child(1){
						font-weight: bold;
						font-size: 32rpx;
					}
					&:nth-child(2){
						font-size: 24rpx;
					}
				}
			}
			.top{
				display: flex;
				justify-content: space-between;
				.head_img{
					width: 80rpx;
					height: 80rpx;
				}
			}
			margin-bottom: 38rpx;
			width: 686rpx;
			height: 328rpx;
			padding: 42rpx;
			position: relative;
			.bg{
				width: 100%;
				height: 100%;
				position: absolute;
				right: 0;
				top: 0;
				z-index: -1;
			}
		}
	}
.member_card{
	padding: 32rpx;
}

</style>
